package com.cj.common.lang;

import java.util.Collection;

import org.apache.commons.lang.builder.ToStringStyle;

public class SpringSideToStringStyle extends ToStringStyle{
	private SpringSideToStringStyle() {
	}
	
	@Override
    protected boolean isFullDetail(Boolean fullDetailRequest) {
        return true;
    }
	private static class Holder {
		public static SpringSideToStringStyle instance = new SpringSideToStringStyle();
	}
	@Override
	protected void appendInternal(StringBuffer buffer, String fieldName,
			Object value, boolean detail) {
		super.appendInternal(buffer, fieldName, value, detail);
	}
	
	public static SpringSideToStringStyle getInstance() {
		return Holder.instance;
	}
	@Override
    protected void appendDetail(StringBuffer buffer, String fieldName, Collection coll) {
        buffer.append(fieldName).append(" = Collection");
    }
	@Override
    protected void appendDetail(StringBuffer buffer, String fieldName, Object value) {
        buffer.append(value);
    }

}
